home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AOL File Library: 2,801 to 2,900
/
aol-file-protocol-4400-2801-to-2900.zip
/
AOLDLs
/
C++ Files Library
/
Public C++ Objects
/
PublicObjects.sit
/
CPublicObject.h
< prev
next >
Wrap
Text File
|
1995-07-18
|
1KB
|
59 lines
/******************************************************************************
CPublicObject.h
The Public Object Class
A class that defines a linked list of objects. Whenever an instance of
CPublicObject is created, it is added to a linked list of other public
objects. This makes it easy to search for objects at run-time.
SUPERCLASS = TCL_AUTO_DESTRUCT_OBJECT
Written By: Matt Mendrala
Created: 7/18/95
******************************************************************************/
#pragma once
#include "TCL.h"
#include "CList.h"
// Forward declarations
class CPublicObject;
typedef CList<CPublicObject> CPublicObjectList;
// Declaration
class CPublicObject TCL_AUTO_DESTRUCT_OBJECT
{
public:
TCL_DECLARE_CLASS // Run-Time Type Identification (RTTI) macro
// Instance variables
long objectID; // Object's unique ID
CPublicObject* next; // Next object in chain
CPublicObject* prev; // Previous object in chain
// Methods
CPublicObject( long ID = 0L );
virtual ~CPublicObject();
void BePublic( void );
void BePrivate( void );
long GetID(){ return objectID; }
// Static
static CPublicObject* head; // First object in chain
static CPublicObject* FindObject( long ID );
static CPublicObject* NextObject( CPublicObject* aObject );
static CPublicObject* PrevObject( CPublicObject* aObject );
static CPublicObject* FirstObject( void ){ return head; }
};